/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.mobiubiq.directory.client.data;

import org.kalmeo.kuix.core.model.DataProvider;
import org.mobiubiq.directory.client.KuixClient;
import org.mobiubiq.directory.client.util.PlatformCapabilities;

/**
 *
 * @author Marnix Renne
 */
public class PlatformCapabilitiesDataProvider extends DataProvider {
    private static final String NFC_AVAILABLE = "nfcAvailable";
    private static final String LOCATION_AVAILABLE = "locationAvailable";
    private static final String BARCODE_AVAILABLE = "barcodeAvailable";
    private static final String FILE_AVAILABLE = "fileAvailable";
    private static final String DEBUG = "debug";

    protected Object getUserDefinedValue(String property) {
        if(NFC_AVAILABLE.equals(property)) {
            return String.valueOf(PlatformCapabilities.hasContactless());
        }
        if(LOCATION_AVAILABLE.equals(property)) {
            return String.valueOf(PlatformCapabilities.hasLocation());
        }
        if(FILE_AVAILABLE.equals(property)) {
            return String.valueOf(PlatformCapabilities.hasFileConnection());
        }
        if(BARCODE_AVAILABLE.equals(property)) {
            return String.valueOf(PlatformCapabilities.hasVideoCapture());
        }
        if(DEBUG.equals(property)) {
            return String.valueOf(KuixClient.isDebug());
        }
        return null;
    }
}
